import 'package:flutter_deer/generated/json/base/json_convert_content.dart';
import 'package:flutter_deer/account/models/user_score_takeout_entity.dart';

UserScoreTakeoutAddEntity $UserScoreTakeoutAddEntityFromJson(Map<String, dynamic> json) {
  final UserScoreTakeoutAddEntity userScoreTakeoutAddEntity = UserScoreTakeoutAddEntity();
  final String? bankId = jsonConvert.convert<String>(json['bankId']);
  if (bankId != null) {
    userScoreTakeoutAddEntity.bankId = bankId;
  }
  final String? cardNo = jsonConvert.convert<String>(json['cardNo']);
  if (cardNo != null) {
    userScoreTakeoutAddEntity.cardNo = cardNo;
  }
  final String? cardUsername = jsonConvert.convert<String>(json['cardUsername']);
  if (cardUsername != null) {
    userScoreTakeoutAddEntity.cardUsername = cardUsername;
  }
  final double? score = jsonConvert.convert<double>(json['score']);
  if (score != null) {
    userScoreTakeoutAddEntity.score = score;
  }
  return userScoreTakeoutAddEntity;
}

Map<String, dynamic> $UserScoreTakeoutAddEntityToJson(UserScoreTakeoutAddEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['bankId'] = entity.bankId;
  data['cardNo'] = entity.cardNo;
  data['cardUsername'] = entity.cardUsername;
  data['score'] = entity.score;
  return data;
}

UserScoreTakeoutEntity $UserScoreTakeoutEntityFromJson(Map<String, dynamic> json) {
  final UserScoreTakeoutEntity userScoreTakeoutEntity = UserScoreTakeoutEntity();
  final int? id = jsonConvert.convert<int>(json['id']);
  if (id != null) {
    userScoreTakeoutEntity.id = id;
  }
  final int? bankId = jsonConvert.convert<int>(json['bankId']);
  if (id != null) {
    userScoreTakeoutEntity.bankId = bankId;
  }
  final String? bankName = jsonConvert.convert<String>(json['bankName']);
  if (bankName != null) {
    userScoreTakeoutEntity.bankName = bankName;
  }
  final String? bankLogo = jsonConvert.convert<String>(json['bankLogo']);
  if (bankLogo != null) {
    userScoreTakeoutEntity.bankLogo = bankLogo;
  }
  final String? bankUserName = jsonConvert.convert<String>(json['bankUserName']);
  if (bankUserName != null) {
    userScoreTakeoutEntity.bankUserName = bankUserName;
  }
  final String? cardNo = jsonConvert.convert<String>(json['cardNo']);
  if (cardNo != null) {
    userScoreTakeoutEntity.cardNo = cardNo;
  }
  final double? score = jsonConvert.convert<double>(json['score']);
  if (score != null) {
    userScoreTakeoutEntity.score = score;
  }
  final double? beforeScore = jsonConvert.convert<double>(json['beforeScore']);
  if (beforeScore != null) {
    userScoreTakeoutEntity.beforeScore = beforeScore;
  }
  final String? status = jsonConvert.convert<String>(json['status']);
  if (status != null) {
    userScoreTakeoutEntity.status = status;
  }
  final String? remark = jsonConvert.convert<String>(json['remark']);
  if (remark != null) {
    userScoreTakeoutEntity.remark = remark;
  }
  final String? createTimeStr = jsonConvert.convert<String>(json['createTimeStr']);
  if (createTimeStr != null) {
    userScoreTakeoutEntity.createTimeStr = createTimeStr;
  }
  final String? approvalTimeStr = jsonConvert.convert<String>(json['approvalTimeStr']);
  if (approvalTimeStr != null) {
    userScoreTakeoutEntity.approvalTimeStr = approvalTimeStr;
  }
  return userScoreTakeoutEntity;
}

Map<String, dynamic> $UserScoreTakeoutEntityToJson(UserScoreTakeoutEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['bankId'] = entity.bankId;
  data['bankName'] = entity.bankName;
  data['bankLogo'] = entity.bankLogo;
  data['bankUserName'] = entity.bankUserName;
  data['cardNo'] = entity.cardNo;
  data['score'] = entity.score;
  data['beforeScore'] = entity.beforeScore;
  data['status'] = entity.status;
  data['remark'] = entity.remark;
  data['createTimeStr'] = entity.createTimeStr;
  data['approvalTimeStr'] = entity.approvalTimeStr;
  return data;
}

UserScoreTakeoutPageEntity $UserScoreTakeoutPageEntityFromJson(Map<String, dynamic> json) {
  final UserScoreTakeoutPageEntity userScoreTakeoutPageEntity = UserScoreTakeoutPageEntity();
  final int? total = jsonConvert.convert<int>(json['total']);
  if (total != null) {
    userScoreTakeoutPageEntity.total = total;
  }
  final int? size = jsonConvert.convert<int>(json['size']);
  if (size != null) {
    userScoreTakeoutPageEntity.size = size;
  }
  final int? current = jsonConvert.convert<int>(json['current']);
  if (current != null) {
    userScoreTakeoutPageEntity.current = current;
  }
  final int? pages = jsonConvert.convert<int>(json['pages']);
  if (pages != null) {
    userScoreTakeoutPageEntity.pages = pages;
  }
  final List<UserScoreTakeoutEntity>? records = jsonConvert.convert<List<UserScoreTakeoutEntity>>(json['records']);
  if (records != null) {
    userScoreTakeoutPageEntity.records = records;
  }
  return userScoreTakeoutPageEntity;
}

Map<String, dynamic> $UserScoreTakeoutPageEntityToJson(UserScoreTakeoutPageEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['total'] = entity.total;
  data['size'] = entity.size;
  data['current'] = entity.current;
  data['pages'] = entity.pages;
  data['records'] = entity.records;
  return data;
}

BelowUserScoreTakeoutStatisticsEntity $BelowUserScoreTakeoutStatisticsEntityFromJson(Map<String, dynamic> json) {
  final BelowUserScoreTakeoutStatisticsEntity belowUserScoreTakeoutStatisticsEntity = BelowUserScoreTakeoutStatisticsEntity();
  final double? totalScore = jsonConvert.convert<double>(json['totalScore']);
  if (totalScore != null) {
    belowUserScoreTakeoutStatisticsEntity.totalScore = totalScore;
  }
  final int? totalTimes = jsonConvert.convert<int>(json['totalTimes']);
  if (totalTimes != null) {
    belowUserScoreTakeoutStatisticsEntity.totalTimes = totalTimes;
  }
  return belowUserScoreTakeoutStatisticsEntity;
}

Map<String, dynamic> $BelowUserScoreTakeoutStatisticsEntityToJson(BelowUserScoreTakeoutStatisticsEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['totalScore'] = entity.totalScore;
  data['totalTimes'] = entity.totalTimes;
  return data;
}

BelowUserScoreTakeoutEntity $BelowUserScoreTakeoutEntityFromJson(Map<String, dynamic> json) {
  final BelowUserScoreTakeoutEntity belowUserScoreTakeoutEntity = BelowUserScoreTakeoutEntity();
  final double? score = jsonConvert.convert<double>(json['score']);
  if (score != null) {
    belowUserScoreTakeoutEntity.score = score;
  }
  final double? beforeScore = jsonConvert.convert<double>(json['beforeScore']);
  if (beforeScore != null) {
    belowUserScoreTakeoutEntity.beforeScore = beforeScore;
  }
  final String? createTime = jsonConvert.convert<String>(json['createTime']);
  if (createTime != null) {
    belowUserScoreTakeoutEntity.createTime = createTime;
  }
  final String? updateTime = jsonConvert.convert<String>(json['updateTime']);
  if (updateTime != null) {
    belowUserScoreTakeoutEntity.updateTime = updateTime;
  }
  final String? avatar = jsonConvert.convert<String>(json['avatar']);
  if (avatar != null) {
    belowUserScoreTakeoutEntity.avatar = avatar;
  }
  final String? accountId = jsonConvert.convert<String>(json['accountId']);
  if (accountId != null) {
    belowUserScoreTakeoutEntity.accountId = accountId;
  }
  final String? username = jsonConvert.convert<String>(json['username']);
  if (username != null) {
    belowUserScoreTakeoutEntity.username = username;
  }
  return belowUserScoreTakeoutEntity;
}

Map<String, dynamic> $BelowUserScoreTakeoutEntityToJson(BelowUserScoreTakeoutEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['score'] = entity.score;
  data['beforeScore'] = entity.beforeScore;
  data['createTime'] = entity.createTime;
  data['updateTime'] = entity.updateTime;
  data['avatar'] = entity.avatar;
  data['accountId'] = entity.accountId;
  data['username'] = entity.username;
  return data;
}

BelowUserScoreTakeoutPageEntity $BelowUserScoreTakeoutPageEntityFromJson(Map<String, dynamic> json) {
  final BelowUserScoreTakeoutPageEntity belowUserScoreTakeoutPageEntity = BelowUserScoreTakeoutPageEntity();
  final int? total = jsonConvert.convert<int>(json['total']);
  if (total != null) {
    belowUserScoreTakeoutPageEntity.total = total;
  }
  final int? size = jsonConvert.convert<int>(json['size']);
  if (size != null) {
    belowUserScoreTakeoutPageEntity.size = size;
  }
  final int? current = jsonConvert.convert<int>(json['current']);
  if (current != null) {
    belowUserScoreTakeoutPageEntity.current = current;
  }
  final int? pages = jsonConvert.convert<int>(json['pages']);
  if (pages != null) {
    belowUserScoreTakeoutPageEntity.pages = pages;
  }
  final List<BelowUserScoreTakeoutEntity>? records = jsonConvert.convert<List<BelowUserScoreTakeoutEntity>>(json['records']);
  if (records != null) {
    belowUserScoreTakeoutPageEntity.records = records;
  }
  return belowUserScoreTakeoutPageEntity;
}

Map<String, dynamic> $BelowUserScoreTakeoutPageEntityToJson(BelowUserScoreTakeoutPageEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['total'] = entity.total;
  data['size'] = entity.size;
  data['current'] = entity.current;
  data['pages'] = entity.pages;
  data['records'] = entity.records;
  return data;
}
